package com.demo15;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class OutputStreamDemo1 {
    public static void main(String[] args) throws IOException {
        //创建一个文件字节流的输出流对象
        FileOutputStream fos = new FileOutputStream("idea_demo\\java\\JavaSE\\javaSE.txt");

        //打开一个文件输出流
//        fos.write(97);
//        fos.write(57);
//        fos.write(55);

        byte[] bytes = "hello张三".getBytes();
        fos.write(bytes,0,bytes.length-6);
        //字节流数组写入，关闭链接
        fos.close();
    }
}
